package com.yuqiao.read.design.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class PancakeHouseMenu implements Menu{

    List<MenuItem> menuItems;
    public PancakeHouseMenu(){
        menuItems = new ArrayList<MenuItem>();
        addItem("a","aaa",true,23.2);
        addItem("b","bbb",false,33.2);
        addItem("c","ccc",true,13.2);
        addItem("d","ddd",true,53.2);

    }
    public void addItem(String name,String description,boolean vegetarian,double price){
        MenuItem menuItem = new MenuItem(name,description,vegetarian,price);
        menuItems.add(menuItem);
    }
    @Override
    public Iterator createIterator(){
        return menuItems.iterator();
    }
}
